package com.ruoyi.household.service.impl;

import com.ruoyi.common.dto.NucleicDto;
import com.ruoyi.common.nucleic.NucleicService;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.household.domain.THousehold;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NucleicServiceImpl implements NucleicService {

    @Autowired
    private THouseholdServiceImpl tHouseholdService;

    @Override
    public void nucleAdd(NucleicDto nucleicDto) {
        THousehold tHousehold = new THousehold();
        BeanUtils.copyProperties(nucleicDto,tHousehold);
        tHousehold.setTel(nucleicDto.getPhonenumber());
        tHousehold.setName(nucleicDto.getUsername());
        tHousehold.setStatus(0L);
        tHouseholdService.insertTHousehold(tHousehold);

    }
}
